import iViewTheme from 'iview-layout-themes'
const axios = iViewTheme.util.apiRequest
// 新增用户
export const addUser = (user) => {
  return axios.request({
    url: '/ocr/addUser',
    data: user,
    type: 'post',
    php: true
  })
}
// 删除用户
export const delUser = (userid) => {
  return axios.request({
    url: 'ocr/delUser',
    data: userid,
    type: 'post',
    php: true
  })
}
// 获取用户列表
export const getUserList = () => {
  return axios.request({
    url: '/ocr/getUserList',
    type: 'post',
    php: true
  })
}
// 请求调用OCR识别 包含加密方式http://0.0.0.0:9501/ocr/getInfo?userid=111&secret=698d51a19d8a121ce581499d7b701668&file=https://shangke2.oss-cn-qingdao.aliyuncs.com/newnsfz/110101200810080529.jpg
export const getVisitAddress = (userid) => {
  return axios.request({
    url: 'ocr/getVisitAddress',
    data: userid,
    type: 'post',
    php: true
  })
}
// 添加套餐
export const addMeal = (data) => {
  return axios.request({
    url: '/ocr/addMeal',
    data: data,
    type: 'post',
    php: true
  })
}
// 获取识别套餐列表
export const getMealList = () => {
  return axios.request({
    url: '/ocr/getMealList',
    type: 'post',
    php: true
  })
}
// 用户充值
export const updateCount = (data) => {
  return axios.request({
    url: '/ocr/updateCount',
    data: data,
    type: 'post',
    php: true
  })
}
// 用户充值http://0.0.0.0:9501/ocr/delMeal?id=7c97cc97-2280-805d-f419-df9c97233b2c
export const delMeal = (id) => {
  return axios.request({
    url: '/ocr/delMeal',
    data: id,
    type: 'post',
    php: true
  })
}
// 获取统计数量
// http://0.0.0.0:9501/ocr/getStatistics?userid=71c893db-6d18-31ca-6a4a-d20c096b94a9
export const getStatistics = (id) => {
  return axios.request({
    url: '/ocr/getStatistics',
    data: { userid: id },
    type: 'post',
    php: true
  })
}

// 获取访问列表
// http://0.0.0.0:9501/ocr/getVisitList?userid=71c893db-6d18-31ca-6a4a-d20c096b94a9
export const getVisitList = (data) => {
  return axios.request({
    url: '/ocr/getVisitList',
    data: data,
    type: 'post',
    php: true
  })
}
// 获取充值列表
// http://0.0.0.0:9501/ocr/getUserChargeList?userid=71c893db-6d18-31ca-6a4a-d20c096b94a9
export const getUserChargeList = (id) => {
  return axios.request({
    url: '/ocr/getUserChargeList',
    data: { userid: id },
    type: 'post',
    php: true
  })
}
